<!doctype html>
<html>
	<head>
		<title>PLNRBBDist3</title>
		<!-- Stylesheets -->
        <script src="{{ URL::asset('js/lib/jquery-1.11.2.min.js') }}"></script>
        <script src="{{ URL::asset('js/lib/angular.min.js') }}"></script>
        <script src="{{ URL::asset('js/lib/angular-md5.min.js') }}"></script>
        <script src="{{ URL::asset('js/lib/angular-ui-router.min.js') }}"></script>
        <script src="{{ URL::asset('js/lib/underscore-min.js') }}"></script>
        <script src="{{ URL::asset('js/lib/sugar.min.js') }}"></script>
        <script src="{{ URL::asset('js/lib/ui-bootstrap-tpls-0.12.0.min.js') }}"></script>
        
        <link rel="stylesheet" href="{{ URL::asset('css/bootstrap.min.css') }}">
		<link rel="stylesheet" href="{{ URL::asset('css/bootstrap-theme.min.css') }}">
		<link rel="stylesheet" href="{{ URL::asset('css/animate.min.css') }}">
		<link rel="stylesheet" href="{{ URL::asset('css/style.min.css') }}">
        
        <link rel="shortcut icon" href="{{ asset('favicon.ico') }}">
        
        <script src="{{ URL::asset('js/router.js') }}"></script>
<!--        <script src="{{ URL::asset('js/page/page.min.js') }}"></script>-->
        <script src="{{ URL::asset('js/page/header.min.js') }}"></script>
        <script src="{{ URL::asset('js/page/apk1.min.js') }}"></script>
        <script src="{{ URL::asset('js/page/apk2.min.js') }}"></script>
        
        <script>
            var someusername = "{{ Session::get('PLNRBBDist3_user'); }}";
        </script>
	</head>

	<body>
		<div id="app-container" ng-app="homeApp">
            <script type="text/ng-template" id="accountPopUp.html">
                <div class="modal-body account-popup">
                    <div class="modal-header">
                        <h3>Manage Account</h3>
                    </div>
                    <div class="adder-container noselect" ng-click="addnewuserclick()" ng-hide="loading || nodata">
                        <span class="plnrbbdist-glyphicon glyphicon glyphicon-plus-sign" aria-hidden="true"></span> Add new user
                    </div>
                    <div class="table-container" ng-hide="loading || nodata">
                        <table id="table-manageaccount" class="table table-striped table-bordered">
                            <thead>    
                                <tr>
                                    <th id="table-manageno">No</th>
                                    <th id="table-username">Username</th>
                                    <th id="table-role">Role</th>
                                    <th id="table-manageaction">Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-repeat="value in streams">
                                    <td id="table-manageno">@{{ ((bigCurrentPage - 1) * 10) + $index + 1 }}</td>
                                    <td id="table-username">@{{ value.username }}</td>
                                    <td id="table-role" ng-hide="value.isEdit">@{{ value.role }}</td>
                                    <td ng-show="value.isEdit" class="btn-group table-dropdown" dropdown>
                                        <button type="button" class="btn btn-default dropdown-toggle table-dropdown-button" dropdown-toggle>
                                        @{{ value.role }} <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu table-dropdown-menu noselect" role="menu">
                                            <li ng-click="value.role = 'Admin'">Admin</li>
                                            <li class="divider"></li>
                                            <li ng-click="value.role = 'User'">User</li>
                                        </ul>
                                    </td>
                                    <td ng-hide="value.isEdit" id="table-manageaction" class="noselect">
                                        <div id="table-editor" title="edit" ng-click='editingRole(value)'>
                                            <span class="plnrbbdist-glyphicon glyphicon glyphicon-edit" aria-hidden="true">
                                        </div>
                                        <div id="table-deleter" title="delete" ng-click='removeuserclick(value)'>
                                            <span class="plnrbbdist-glyphicon glyphicon glyphicon-trash" aria-hidden="true">
                                        </div>
                                    </td>
                                    <td ng-show="value.isEdit && !value.disabled" id="table-manageaction" class="noselect">
                                        <div id="table-editor" title="ok" ng-click='doneEditing(value)'>
                                            <span class="plnrbbdist-glyphicon glyphicon glyphicon-ok" aria-hidden="true">
                                        </div>
                                        <div id="table-deleter" title="cancel" ng-click='cancelEditing(value)'>
                                            <span class="plnrbbdist-glyphicon glyphicon glyphicon-remove" aria-hidden="true">
                                        </div>
                                    </td>
                                    <td ng-show="value.isEdit && value.disabled" id="table-manageaction" class="noselect nopointer form-loader-blue">
                                        <span class="glyphicon glyphicon-refresh gly-spin"></span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="table-nodata-container foracount" ng-show="nodata && !loading">
                        <table id="nodatatable">
                            <tr>
                                <td>
                                    <span class="plnrbbdist-glyphicon glyphicon glyphicon-signal" aria-hidden="true"></span><br />
                                    <h5>Empty Data.<br />Please refresh this page or check your internet connection.</h5>
                                </td>
                            </tr>
                            <tr></tr>
                        </table>
                    </div>
                    <div class="table-loading-container foracount" ng-show="loading">
                        <table id="nodatatable" class="sebenernyabuatloaderaccount">
                            <tr>
                                <td>
                                    <span class="glyphicon glyphicon-refresh gly-spin"></span>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="pagination-container" ng-hide="loading || nodata">
                        <pagination 
                            total-items     = "datamember.length" 
                            ng-model        = "bigCurrentPage" 
                            items-per-page  = "totalstreams" 
                            max-size        = "maxSize" 
                            class           = "pagination-sm" 
                            boundary-links  = "true" 
                            rotate          = "false"
                            num-pages       = "numPages"
                            previous-text   = "&lsaquo;"
                            next-text       = "&rsaquo;"
                            first-text      = "&laquo;"
                            last-text       = "&raquo;"
                        >
                        </pagination>
                    </div>
                    <div class="confirmation-container" ng-hide="loading || nodata">
                        <button class="btn btn-primary" ng-click="ok()">Done</button>
                    </div>
                </div>
            </script>
            <script type="text/ng-template" id="passwordPopUp.html">
                <div class="modal-body password-popup">
                    <div class="modal-header">
                        <h3>Change Password</h3>
                    </div>
                    <form id="group-input">
                        <div class="form-group">
                            <label for="password">Current Password</label>
                            <input type="password" class="form-control" ng-model="current_password" ng-disabled="disabled" required></input>
                        </div>
                        <div class="form-group">
                            <label for="password">New Password</label>
                            <input type="password" class="form-control" ng-model="new_password" ng-disabled="disabled" required></input>
                        </div>
                        <div class="form-group">
                            <label for="password">New Password Confirmation</label>
                            <input type="password" class="form-control" ng-model="another_password" ng-disabled="disabled" required></input>
                        </div>
                        <div id="errorspan" >
                            <span ng-show="isError">@{{errormessage}}</span>
                        </div>
                        <div class="form-action">
                            <button ng-click="ok('{{ Session::get('PLNRBBDist3_user'); }}')" ng-show='youwish'>Login</button>
                        </div>
                    </form>
                    <div class="modal-footer" ng-hide=disabled>
                        <button class="btn btn-primary" ng-click="ok('{{ Session::get('PLNRBBDist3_user'); }}')">Change</button>
                        <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
                    </div>
                    <div class="modal-footer" ng-show="disabled">
                        <div class="form-loader form-loader-blue">
						  <span class="glyphicon glyphicon-refresh gly-spin"></span>
                        </div>
                    </div>
                </div>
            </script>
			<script type="text/ng-template" id="notificationPopUp.html">
                <div class="modal-body notification-popup">
                    <div class="message">
                        @{{message}}
                    </div>
                    
                    <div class="confirmation">
                        <button class="btn btn-primary" ng-click="ok()">OK</button>
                    </div>
                </div>
            </script>
            <script type="text/ng-template" id="newuserPopUp.html">
                <div class="modal-body password-popup">
                    <div class="modal-header">
                        <h3>Create New Account</h3>
                    </div>
                    <form id="group-input">
                        <div class="form-group">
                            <label for="username">Username</label>
                            <input type="text" class="form-control" ng-model="new_username" ng-disabled="disabled" required></input>
                        </div>
                        <div class="form-group">
                            <label for="password">Password</label>
                            <input type="password" class="form-control" ng-model="new_password" ng-disabled="disabled" required></input>
                        </div>
                        <div class="form-group">
                            <label for="password">Password Confirmation</label>
                            <input type="password" class="form-control" ng-model="another_password" ng-disabled="disabled" required></input>
                        </div>
                        <div class="form-group" ng-init="new_role = 'Admin'">
                            <label for="role">Role</label>
                            <div class="btn-group newuser-dropdown" ng-disabled="disabled" dropdown>
                                <button type="button" class="btn btn-default dropdown-toggle newuser-dropdown-button" dropdown-toggle>
                                @{{ new_role }} <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu noselect newuser-dropdown-menu" role="menu">
                                    <li ng-click="new_role = 'Admin'">Admin</li>
                                    <li class="divider"></li>
                                    <li ng-click="new_role = 'User'">User</li>
                                </ul>
                            </div>
                        </div>
                        <div id="errorspan" >
                            <span ng-show="isError">@{{errormessage}}</span>
                        </div>
                        <div class="form-action">
                            <button ng-click="ok('{{ Session::get('PLNRBBDist3_user'); }}')" ng-show='youwish'>Login</button>
                        </div>
                    </form>
                    <div class="modal-footer" ng-hide="disabled">
                        <button class="btn btn-primary" ng-click="ok('{{ Session::get('PLNRBBDist3_user'); }}')">Create</button>
                        <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
                    </div>
                    <div class="modal-footer" ng-show="disabled">
                        <div class="form-loader form-loader-blue">
						  <span class="glyphicon glyphicon-refresh gly-spin"></span>
                        </div>
                    </div>
                </div>
            </script>
            <script type="text/ng-template" id="AnotherDeletePopUp.html">
                <div ng-hide="disabled" class="modal-body delete-popup">
                    <img ng-src="warning-sign.jpg" class="img-responsive" alt="Responsive image">
                    <div id="delete-notification"><h4>Are you sure that you want to permanently delete user @{{username}}?</h4></div>
                    <div class="modal-footer">
                        <button class="btn btn-primary" ng-click="ok()">OK</button>
                        <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
                    </div>            
                </div>
                <div ng-show="disabled" class="modal-body delete-popup form-loader-blue form-loader-big form-loader-padding">
                      <span class="glyphicon glyphicon-refresh gly-spin"></span>    
                </div>
            </script>
			<nav id="app-navbar" class="navbar navbar-default navbar-fixed-top navbar-inverse" role="navigation">
				<div class="container-fluid">
					<div class="navbar-header">
                        <img src="LogoPLN.jpg" height="40">
						<a class="navbar-brand" href="#">PLNRBBDist3</a>
					</div>

					<div class="collapse navbar-collapse" id="app-navbar-collapse" ng-controller="dropdownController">
						<ul class="nav navbar-nav">
                            <li class="navbar-li" ui-sref-active="active"><a ui-sref="apk1"><img ng-src="Alis Inul.png"><span>Alis Inul</span></a></li>
                            <li class="navbar-li" ui-sref-active="active"><a ui-sref="apk2"><img ng-src="Apem Basi.png"><span>Apem Basi</span></a></li>
						</ul>
				
                        <div class="dropdown-wrapper noselect" dropdown>
                            <div class="dropdown-toggle" dropdown-toggle>
                                <i class="dropdown-glyphicon glyphicon glyphicon-cog"></i> Settings</a> <span class="caret"></span>
                            </div>
                            <ul class="dropdown-menu" role="menu">
                                <li ng-show="checkUser('{{ Session::get('PLNRBBDist3_user'); }}')" class="dropdown-list" ng-click="clickaccount()">
                                    <span class="plnrbbdist-glyphicon glyphicon glyphicon-user" aria-hidden="true"> Manage Account
                                </li>
                                <li ng-show="checkUser('{{ Session::get('PLNRBBDist3_user'); }}')" class="divider"></li>
                                <li class="dropdown-list" ng-click="clickpassword()">
                                    <span class="plnrbbdist-glyphicon glyphicon glyphicon-th" aria-hidden="true"> Change Password
                                </li>
                                <li class="divider"></li>
                                <li class="dropdown-list" ng-click="clicklogout()">
                                    <span class="plnrbbdist-glyphicon glyphicon glyphicon-off" aria-hidden="true"> Logout
                                </li>
                            </ul>
                        </div>
					</div><!-- /.navbar-collapse -->
				</div><!-- /.container-fluid -->
			</nav>

			<div id="app-content">
				
				<div class="page" ui-view></div>

			</div><!-- #app-content -->
		</div><!-- #app-container -->
	</body>

</html>